﻿using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

using WXWorkSvc.Common.Extensions;
using WXWorkSvc.Models;

namespace WXWorkSvc.Controllers;

[Route("api/[controller]")]
[ApiController]
public class DataController : ControllerBase
{
    private readonly ILogger<CommandController> _logger;
    private readonly Cryptography _Cryptography;
    private readonly WXWork3rd _wx;
    private readonly WXDbContext _db;
    public DataController(ILogger<CommandController> logger, Cryptography cryptography, WXWork3rd wx, WXDbContext db)
    {
        _logger = logger;
        _Cryptography = cryptography;
        _wx = wx;
        _db = db;
    }

    [HttpGet]
    public string Get(string msg_signature, string timestamp, string nonce, string echostr)
    {
        _Cryptography.VerifyURL(msg_signature, timestamp, nonce, echostr, out var decryptMsg, out _);
        return decryptMsg!;
    }

}
